package top.byteio.common.swagger.annotation;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;
import top.byteio.common.core.factory.YmlPropertySourceFactory;
import top.byteio.common.swagger.config.OpenAPIDefinitionImportSelector;
import top.byteio.common.swagger.support.SwaggerProperties;

import java.lang.annotation.*;

/**
 * 启用Jole的Spring文档支持
* @author lerryxia
*/
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@EnableConfigurationProperties(SwaggerProperties.class)
@Import(OpenAPIDefinitionImportSelector.class)
@PropertySource(value = "classpath:openapi-config.yaml", factory = YmlPropertySourceFactory.class)
public @interface EnableJoleApiDoc {

	/**
	 * 网关路由前缀
	 * @return String
	 */
	String value();

	/**
	 * 是否是微服务架构
	 * @return true
	 */
	boolean isMicro() default true;

}
